package com.ruoyi.doorcontrol.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.doorcontrol.mapper.ThDoorcontrolUserMapper;
import com.ruoyi.doorcontrol.domain.ThDoorcontrolUser;
import com.ruoyi.doorcontrol.service.IThDoorcontrolUserService;

/**
 * 门禁用户Service业务层处理
 * 
 * @author zhang
 * @date 2024-07-18
 */
@Service
public class ThDoorcontrolUserServiceImpl implements IThDoorcontrolUserService 
{
    @Autowired
    private ThDoorcontrolUserMapper thDoorcontrolUserMapper;

    /**
     * 查询门禁用户
     * 
     * @param id 门禁用户主键
     * @return 门禁用户
     */
    @Override
    public ThDoorcontrolUser selectThDoorcontrolUserById(Long id)
    {
        return thDoorcontrolUserMapper.selectThDoorcontrolUserById(id);
    }

    /**
     * 查询门禁用户列表
     * 
     * @param thDoorcontrolUser 门禁用户
     * @return 门禁用户
     */
    @Override
    public List<ThDoorcontrolUser> selectThDoorcontrolUserList(ThDoorcontrolUser thDoorcontrolUser)
    {
        return thDoorcontrolUserMapper.selectThDoorcontrolUserList(thDoorcontrolUser);
    }

    /**
     * 新增门禁用户
     * 
     * @param thDoorcontrolUser 门禁用户
     * @return 结果
     */
    @Override
    public int insertThDoorcontrolUser(ThDoorcontrolUser thDoorcontrolUser)
    {
        thDoorcontrolUser.setCreateTime(DateUtils.getNowDate());
        return thDoorcontrolUserMapper.insertThDoorcontrolUser(thDoorcontrolUser);
    }

    /**
     * 修改门禁用户
     * 
     * @param thDoorcontrolUser 门禁用户
     * @return 结果
     */
    @Override
    public int updateThDoorcontrolUser(ThDoorcontrolUser thDoorcontrolUser)
    {
        return thDoorcontrolUserMapper.updateThDoorcontrolUser(thDoorcontrolUser);
    }

    /**
     * 批量删除门禁用户
     * 
     * @param ids 需要删除的门禁用户主键
     * @return 结果
     */
    @Override
    public int deleteThDoorcontrolUserByIds(Long[] ids)
    {
        return thDoorcontrolUserMapper.deleteThDoorcontrolUserByIds(ids);
    }

    /**
     * 删除门禁用户信息
     * 
     * @param id 门禁用户主键
     * @return 结果
     */
    @Override
    public int deleteThDoorcontrolUserById(Long id)
    {
        return thDoorcontrolUserMapper.deleteThDoorcontrolUserById(id);
    }

    @Override
    public List<ThDoorcontrolUser> selectByVisitPlateNum(String plateNum, String visitEffectiveTime) {
        return thDoorcontrolUserMapper.selectByVisitPlateNum(plateNum,visitEffectiveTime);
    }

    @Override
    public ThDoorcontrolUser selectEmployeeNo(String employeeId) {
        return thDoorcontrolUserMapper.selectEmployeeNo(employeeId);
    }

    @Override
    public int batchupdateThDoorcontrolUser(List<ThDoorcontrolUser> thDoorcontrolOldUsers) {
        return thDoorcontrolUserMapper.batchupdateThDoorcontrolUser(thDoorcontrolOldUsers);
    }
}
